package com.cjm.gui;

import javafx.scene.input.MouseButton;

import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

public class Demo1 {
    public static void main(String[] args) {
        initUI();
    }
    public static void initUI() {
        JFrame jf = new JFrame();
        jf.setSize(900, 800);
        jf.setTitle("画图工具");
        jf.setLocationRelativeTo(null);
        jf.setDefaultCloseOperation(3);
        jf.setLayout(new BorderLayout());

        JPanel northPanel = new JPanel();
        northPanel.setBackground(Color.BLUE);
        northPanel.setPreferredSize(new Dimension(0, 40));
        jf.add(northPanel, BorderLayout.NORTH);

        JButton lineB = new JButton("直线");
        northPanel.add(lineB);

        JButton curB = new JButton("曲线");
        northPanel.add(curB);

        JButton rectB = new JButton("矩形");
        northPanel.add(rectB);

        JButton angelB = new JButton("三角形");
        northPanel.add(angelB);

        JButton polyB = new JButton("多边形");
        northPanel.add(polyB);

        JButton colorB = new JButton("红色");
        northPanel.add(colorB);

        jf.setVisible(true);

    }
}
